package com.apptonelabs.android.model;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

@SuppressWarnings("serial")
public class TrainDetails implements Serializable {
	private long id;
	private String number;
	private String name;
	private String boardingDate;
	private String from;
	private String to;
	private String reservedUpto;
	private String boardingPoint;
	private String reservedType;
	private String chatStatus;

	/**
	 * @return the number
	 */
	public String getNumber() {
		return number;
	}

	/**
	 * @param number
	 *            the number to set
	 */
	public void setNumber(String number) {
		this.number = number;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the boardingDate
	 */
	public String getBoardingDate() {
		return boardingDate;
	}

	/**
	 * @param boardingDate
	 *            the boardingDate to set
	 */
	public void setBoardingDate(String boardingDate) {
		this.boardingDate = boardingDate;
	}

	/**
	 * @return the from
	 */
	public String getFrom() {
		return from;
	}

	/**
	 * @param from
	 *            the from to set
	 */
	public void setFrom(String from) {
		this.from = from;
	}

	/**
	 * @return the to
	 */
	public String getTo() {
		return to;
	}

	/**
	 * @param to
	 *            the to to set
	 */
	public void setTo(String to) {
		this.to = to;
	}

	/**
	 * @return the reservedUpto
	 */
	public String getReservedUpto() {
		return reservedUpto;
	}

	/**
	 * @param reservedUpto
	 *            the reservedUpto to set
	 */
	public void setReservedUpto(String reservedUpto) {
		this.reservedUpto = reservedUpto;
	}

	/**
	 * @return the boardingPoint
	 */
	public String getBoardingPoint() {
		return boardingPoint;
	}

	/**
	 * @param boardingPoint
	 *            the boardingPoint to set
	 */
	public void setBoardingPoint(String boardingPoint) {
		this.boardingPoint = boardingPoint;
	}

	/**
	 * @return the reservedType
	 */
	public String getReservedType() {
		return reservedType;
	}

	/**
	 * @param reservedType
	 *            the reservedType to set
	 */
	public void setReservedType(String reservedType) {
		this.reservedType = reservedType;
	}

	/**
	 * @return the chatStatus
	 */
	public String getChatStatus() {
		return chatStatus;
	}

	/**
	 * @param chatStatus
	 *            the chatStatus to set
	 */
	public void setChatStatus(String chatStatus) {
		this.chatStatus = chatStatus;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	public static byte[] serialize(Object obj) throws IOException {
	    ByteArrayOutputStream out = new ByteArrayOutputStream();
	    ObjectOutputStream os = new ObjectOutputStream(out);
	    os.writeObject(obj);
	    return out.toByteArray();
	}

	public static TrainDetails deserialize(byte[] data) throws IOException, ClassNotFoundException {
	    ByteArrayInputStream in = new ByteArrayInputStream(data);
	    ObjectInputStream is = new ObjectInputStream(in);
	    return (TrainDetails) is.readObject();
	}

}
